package com.mzxy.mztopline.adapter;

import java.util.List;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import  androidx.fragment.app.FragmentPagerAdapter;


/**
 * 主页面，页面切换适配器
 */

public class MyFragmentPargerAdapter  extends FragmentPagerAdapter{

    private List<Fragment> fragments = null;

    public MyFragmentPargerAdapter(@NonNull FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragments = fragments;
    }

    @NonNull
    @Override
    public Fragment getItem(int position) {
        return fragments.get(position);
    }

    @Override
    public int getCount() {
        return fragments.size();
    }
}
